package com.pgyl.contract.validator;

import com.pgyl.contract.exceptions.ValidationException;
import com.pgyl.contract.model.PurchaseContract;
import org.springframework.stereotype.Component;

// 采购合同校验实现
@Component
public class PurchaseContractValidator implements ContractValidator<PurchaseContract> {
    @Override
    public void validate(PurchaseContract contract) throws ValidationException {
        if (!contract.getSupplierCode().startsWith("P")) {
            throw new ValidationException("采购合同编号必须P开头");
        }
        // 其他校验规则...
    }
}
